package com.whacos.modules.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.whacos.common.enums.DelFlagEnum;
import com.whacos.common.shiro.ShiroUtils;
import com.whacos.common.utils.DateUtils;
import com.whacos.modules.system.dao.LogDao;
import com.whacos.modules.system.entity.Log;
import com.whacos.modules.system.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author xiongdun
 * @description SysLogServiceImpl
 * @since 2018/11/17 17:11
 */
@Service
public class LogServiceImpl extends ServiceImpl<LogDao, Log> implements LogService {

    @Async
    @Override
    public void add(Log log) {
        log.createdData(ShiroUtils.getUserId());
        this.baseMapper.insert(log);
    }

    @Override
    public void clear() {
        this.baseMapper.clearLog();
    }
}
